<template>
    <div ref="el" :style="style" style="position: fixed;border: 1px solid red;">
        Drag me! I am at {{ x }}, {{ y }}
    </div>
</template>

<script setup>
import { ref } from 'vue';

import { useDraggable } from '@vueuse/core';

const el = ref(null);

const { x, y, style } = useDraggable(el, {
    initialValue: { x: 40, y: 40}
});

</script>

<style lang="scss" scoped>

</style>